import { useStationDataStoreWithOut } from '@/store/modules/stationData';

const stationDataStore = useStationDataStoreWithOut();

/**
 * 监听各类交互事件
 * @param event
 */
export function _onEvent(event: any) {
  console.log(event, 'event');

  if (event.eventtype === 'LeftMouseButtonClick' && event.Type === 'marker') {
    const userData = event.UserData;
    const stcd = userData.split('_')[0];
    const sttp = userData.split('_')[1];
    const stnm = userData.split('_')[2];
    // 调用测站弹窗
    stationDataStore.setStationData({ stcd, sttp, stnm });
  }
}
